/*
 * @Author: 张小平
 * @Date:   2025-05-01
 * @Email:  qqshuqian@163.com
 * @Copyright © 2024 aseyun. All rights reserved.
 */
import request from '@/framework-core/axios';
import website from '@/framework-core/config/website';

/**
 * 获取用户信息
 */
export function getUser() {
    return request({
        url: website.baseUrl + '/api/user/get',
        method: 'get'
    });
}

/**
 * 更新密码
 * @param password
 * @param newPassword
 */
export function updatePassword(password,newPassword) {
  return request({
    url: website.baseUrl + '/api/user/psw/update',
    data: {"password": password, "newPassword": newPassword},
    method: 'post'
  });
}



/**
 * 更新
 * @param user
 */
export function updateBasic(user) {
  return request({
    url: website.baseUrl + '/api/user/save',
    data: user,
    method: 'post'
  });
}


export function fetchOrgTree(query) {
    return request({
        url: website.baseUrl+'/api/sys/org/tree',
        method: 'post',
        params: query
    })
}

export function fetchRoleList(query) {
    return request({
        url: website.baseUrl+'/api/sys/role/listByTenant',
        method: 'post',
        params: query
    })
}

export function getDomainTenant() {
    return request({
        url: website.baseUrl+'/api/sys/comm/getDomainTenant',
        method: 'post'
    })
}


/**
 * 获取用户信息
 */
export function getUsersByids(ids) {
    return request({
        url: website.baseUrl + '/api/user/byIds',
        method: 'post',
        data: ids
    });
}


export function sendContent(data) {
    return request({
        url: website.baseUrl+'/api/gtp/sse/send',
        method: 'post',
        data:data
    })

}

export function sendChat(data) {
    return request({
        url: website.baseUrl+'/api/gtp/sse/chat',
        method: 'post',
        data:data
    })

}

/**
 * AI获取数据
 */
export function getAiData(data) {
    return request({
        url: website.baseUrl + '//api/code/ai/aiData',
        method: 'post',
        data: data
    });
}


